package Einkaufer;

import java.sql.ResultSet;
import java.sql.SQLException;


import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;

public class VehiclePart {
	
	private VehiclePartModel combomodel;
	
	
	public VehiclePart(){
		
		this.combomodel = new VehiclePartModel();
		
	}
	
	
	public void initVehiclePart(Connection cn) throws SQLException {
		
		ResultSet rs;
        Statement st = (Statement) cn.createStatement();
        rs = st.executeQuery("SELECT vehiclepart.name FROM vehiclepart");
        String res = new String("test1");
        while (rs.next()) {
            res = rs.getString("name");
            
            combomodel.addElement(new KomponentenList(res));
            

        }
		
	}
	
	public VehiclePartModel getCombomodel() {
		return combomodel;
	}


}
